package com.bicon.botu.mall.order.processor.handler;

import com.bicon.botu.core.base.common.entity.BaseResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 库存信息Rpc
 * @author 李双喜
 * @date 2018/5/14 17:43
 */
public interface ProductRepertoryRpc {
    /**
     * 根据多个库存id，查询商品库存信息
     *
     * @param productRepertoryIdList 多个商品库存id
     * @return
     */
    @RequestMapping(value = "/V1.0.0/rpc/mallGoods/productRepertory", method = RequestMethod.POST)
    String selectProductRepertory(@RequestParam(value = "productRepertoryIdList") String[] productRepertoryIdList);

    /**
     * 根据多个库存商品校验全部商品是否有库存
     *
     * @param verifyDtoListJson 多个商品信息
     * @return
     */
    @RequestMapping(value = "/V1.0.0/rpc/mallGoods/verifyProduct", method = RequestMethod.POST)
    String verifyProduct(@RequestParam(value = "verifyDtoList") String verifyDtoListJson);

    /**
     * 根据商品库存ID查询商品库存详情
     * @param id
     * @return
     */
    @RequestMapping(value = "/V3.0.0/rpc/productRepertory/selectProductById", method = RequestMethod.POST)
    String selectProductById(@RequestParam(value = "id") String id);

    /**
     * 根据商品库存ID回退商品库存数量
     * @param num   数量
     * @param id    id
     * @return
     */
    @RequestMapping(value = "/V3.0.0/rpc/productRepertory/rollbackById", method = RequestMethod.POST)
    BaseResult rollbackById(@RequestParam(value = "num") Integer num, @RequestParam(value = "id") String id);

    /**
     * 根据商品库存ID回退商品库存数量
     * @param id    id
     * @param num   数量
     * @return
     */
    @RequestMapping(value = "/V3.0.0/rpc/productRepertory/addSalesById", method = RequestMethod.POST)
    BaseResult addSalesById(@RequestParam(value = "num") Integer num, @RequestParam(value = "id") String id);

    /**
     * 添加销量
     * @param verifyDtoListJson
     * @return
     */
    @RequestMapping(value = "/V3.0.0/rpc/productRepertory/addSales", method = RequestMethod.POST)
    public BaseResult addSales(@RequestParam(value = "verifyDtoListJson") String verifyDtoListJson);

    /**
     * 回退商品数量
     * @param verifyDtoListJson
     * @return
     */
    @RequestMapping(value = "/V3.0.0/rpc/productRepertory/rollbackNum", method = RequestMethod.POST)
    public BaseResult rollbackNum(@RequestParam(value = "verifyDtoListJson") String verifyDtoListJson);
}
